<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>视频上面的按钮</title>
    <link rel="stylesheet" type="text/css" href="./../../css/video.css" />
    <style>

    .suoding{
      z-index:30;
      position: absolute;
      top:50%;
      left:10px;
      width:30px;
      height: 30px;
      margin-top:-15px;
    }
    </style>
</head>

<body>
    <div id="vm">
        <img src="../../image/jiesuo.png" class="suoding" alt=""  v-if="!suodingflag" @click="suoding()">
        <img src="../../image/11.png" class="suoding" alt="" v-else @click="jiesuo()">
    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/config.js"></script>
<script type="text/javascript" src="../../script/rest.js"></script>
<script type="text/javascript" src="../../script/vue.2.5.js"></script>
<script type="text/javascript" src="../../script/faskclick.js"></script>
<script type="text/javascript">
    var vm = new Vue({
        el: '#vm',
        data: {
            suodingflag:false
        },
        created: function() {
            var _this = this;
            apiready = function() {
                _this.init();
                api.parseTapmode();
                if ('addEventListener' in document) {
                    document.addEventListener('DOMContentLoaded', function() {
                        FastClick.attach(document.body);
                    }, false);
                }
                api.addEventListener({
                    name: 'suodingxianshi'
                }, function(ret, err){
                    _this.suodingflag = true;
                    api.setFrameAttr({
                        hidden: false,
                    });
                    // _this.dingshiyincang()
                });

            }
        },

        methods: {
            init: function() {
            },
            suoding: function(){
              var _this=this;
              _this.suodingflag=true;
              api.setFrameAttr({
                  name: 'beisu',
                  hidden: true
              });
              api.setFrameAttr({
                  name: 'videocontrl',
                  hidden: true
              });
              api.openFrame({
                  name: 'suodingbg',
                  url: './suodingbg.html',
                  rect: {
                      x: 0,
                      y: 0,
                      w: 'auto',
                      h: 'auto',
                  },
                  bounces: true,
                  bgColor: 'rgba(0,0,0,0)',
                  vScrollBarEnabled: true,
                  hScrollBarEnabled: true
              });
            },
            jiesuo(){
              var _this=this;
              _this.suodingflag=false;
              api.closeFrame({
                  name: 'suodingbg'
              });
              api.setFrameAttr({
                  name: 'beisu',
                  hidden: false
              });
              api.setFrameAttr({
                  name: 'videocontrl',
                  hidden: false
              });
              api.bringFrameToFront({
                  from: 'videocontrl'
              });
            },
            dingshiyincang:function() {
                setTimeout(function(){
                  api.setFrameAttr({
                      hidden: true,
                  });
                 }, 3000);
            }


        }
    })
</script>

</html>
